from django.db import models


# Create your models here.
class Content(models.Model):
    id = models.IntegerField(primary_key=True)
    title = models.CharField(max_length=255)
    content = models.CharField(max_length=2550)

    class Meta:
        verbose_name_plural = "导购文章"


# 用户表
class user(models.Model):
    id = models.IntegerField(primary_key=True)
    user_name = models.CharField(max_length=25)
    user_pwd = models.CharField(max_length=25)
    user_phone = models.CharField(max_length=25)
    user_head = models.CharField(max_length=256)
    user_sex = models.IntegerField()
    user_age = models.IntegerField()

    class Meta:
        verbose_name_plural = "用户管理"


# 用户关系表
class liekGoods(models.Model):
    id = models.IntegerField(primary_key=True)
    goods_id = models.IntegerField()
    user_id = models.IntegerField()
    goods_fraction = models.IntegerField()  # 对商品喜欢的分数值

    class Meta:
        verbose_name_plural = "用户和商品对应关系"


# 商品表
class goods(models.Model):
    id = models.IntegerField(primary_key=True)
    title = models.CharField(max_length=256)
    url = models.CharField(max_length=256)
    price = models.CharField(max_length=256)
    xiadanpirce = models.CharField(max_length=256)
    wangwang = models.CharField(max_length=256)
    address = models.CharField(max_length=256)
    imageurl = models.CharField(max_length=256)
    category = models.CharField(max_length=256,default="")

    class Meta:
        verbose_name_plural = "商品信息"
# 爬虫记录表，重复的key不爬取
class Reptile(models.Model):
    id = models.IntegerField(primary_key=True)
    searchkey = models.CharField(max_length=256)
    category = models.CharField(max_length=256,default="")
#爬虫配置
class ReptileSetting(models.Model):
    id = models.IntegerField(primary_key=True)
    searchkey = models.CharField(max_length=256)
    category = models.CharField(max_length=256,default="")
    username = models.CharField(max_length=256,default="")
    userpwd = models.CharField(max_length=256,default="")
# python manage.py migrate
# python manage.py makemigrations
